package game;

public class Poker {
	// 花色
	// 牌面
	
	// 							花色
	// 黑桃A - K		1~13		0
	// 红桃A - K		14~26		1
	// 草花A - K		27~39		2
	// 方片A - K		40~52		3
	// 大鬼 小鬼		53 54		4
	
	int n;

	public int getN() {
		return n;
	}

	public void setN(int n) {
		this.n = n;
	}
	
	//
	public int getType()
	{
		int type = (this.n-1)/13;
		return type;
//		String[] typeStr = {"♠","♥","♣","♦"};
//		return typeStr[type];
	}
	
	public int getNum()
	{
		int num = (this.n-1) % 13;
		if(this.n==53) {
			return 13;
		}
		else if(this.n==54) {
			return 14;
		}
		return num;
//		String[] numStr = {"A","2","3","4","5","6","7","8","9","10","J","Q","K"};
//		return numStr[num];
	}

	public Poker() {
		super();
		// TODO Auto-generated constructor stub
	}

	public Poker(int n) {
		super();
		this.n = n;
	}

	@Override
	public String toString() {
		String[] typeStr = {"♠","♥","♣","♦"};
		String[] numStr = {"3","4","5","6","7","8","9","10","J","Q","K","A","2","小王","大王"};
		
		if(getN()==53) {
			return "小王";
		}
		else if(getN()==54) {
			return "大王";
		}
		
		return typeStr[getType()]+numStr[getNum()];
	}
	
	
}
